<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>统计数据</title>
    <script src="/js/vue.js"></script>
    <script src="/js/jquery.js"></script>
    <script src="/js/axios.min.js"></script>
    <script src="../js/lib-master/index.js"></script>
  
    <link rel="stylesheet" href="../js/lib-master/theme-chalk/index.css">

</head>
<body>
    <div id="app">
        <el-table :data="orderData" :cell-style="rowStyle">
            <el-table-column prop="orderDetailsID" label="订单编号"></el-table-column>
            <el-table-column prop="orderDate" label="商品名称"></el-table-column>
            <el-table-column prop="productDetailID" label="用户名称"></el-table-column>
            <el-table-column prop="productName" label="商品数量"></el-table-column>
            <el-table-column prop="productDetailAmount" label="商品数量"></el-table-column>
            <el-table-column prop="orderTotalPrice" label="订单金额"></el-table-column>
            <el-table-column prop="orderMode" label="支付方式"></el-table-column>
            <el-table-column prop="state" label="订单状态">
              <template scope="scope">    
                <el-tag v-if="scope.row.state == 1">未付款</el-tag>
                <el-tag v-if="scope.row.state == 2">已付款</el-tag>
                <el-tag v-if="scope.row.state == 3">已发货</el-tag>
                <el-tag v-if="scope.row.state == 4">已完成</el-tag>             
              </template>
            </el-table-column>
          </el-table>
    </div>
    <script src="/js/backcommon.js"></script>
    <script>
    
        let vm = new Vue({
          el: "#app",
          data: {
            orderData: [],
          },
          created: function () {
            this.getOrderList()
          },
          methods: {
            rowStyle() {
              return "text-align:center";
            },
            getOrderList:function(){
                axios.post("/orderDetail/getAll").then(function(resp){
                    vm.orderData=resp.data.data
                }) 
            },
          }
        })
      </script>
</body>
</html>